import java.util.ArrayList;
import java.util.List;

/**
 * @author : cww
 * @date : 2021/1/5 23:11
 */
public class Composite extends Shape{
    private List<Shape> shapes=new ArrayList<>();
    @Override
    public void add(Shape shape) {
        shapes.add(shape);
    }

    @Override
    public void remove(Shape shape) {
        shapes.remove(shapes);
    }

    @Override
    public void draw() {
        System.out.println("----组合-----");
        shapes.forEach(t->{
            t.draw();
        });
    }
}
